//
//  TriangleTextureTestScene.h
//  Ray Tracer
//
//  Created by Kaila, Ashish on 4/21/13.
//  Copyright (c) 2013 Kaila, Ashish. All rights reserved.
//

#ifndef Ray_Tracer_TextureTestScene_h
#define Ray_Tracer_TextureTestScene_h

void renderTextureTestScene(Raytracer& raytracer,
                            int width,
                            int height,
                            bool enableSpecular)
{
    // Camera parameters.
	Point3D eye(0, 0, 1);
	Vector3D view(0, 0, -1);
	Vector3D up(0, 1, 0);
	double fov = 100;
    
	// Defines a material for shading.
    TextureMaterial texture("triangle_texture.bmp",
                            Colour(0.3, 0.3, 0.3),
                            51.2,
                            0,
                            0,
                            0);
    
	// Defines a point light source.
	raytracer.addLightSource( new PointLight(Point3D(0, 0, 2),
                                             Colour(0.9, 0.9, 0.9) ),
                             enableSpecular);
    
	// Add a unit square into the scene with material mat.
    TriangleShape* triangle = new TriangleShape(Point3D(-1, 0.5, -1), Point3D(1, 0.5, -1), Point3D(0, -0.5, -1), &texture);
    triangle->setTexturePoint(0, 0.25, 0.75);
    triangle->setTexturePoint(1, 0.75, 0.75);
    triangle->setTexturePoint(2, 0.50, 0.25);
    SceneDagNode* model = raytracer.addObject(triangle);
    
	// Render the scene, feel free to make the image smaller for
	// testing purposes.
	raytracer.render(width, height, eye, view, up, fov, "texture_test.bmp");
}


#endif
